package com.taotao.tools.validate.iface;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.lang.annotation.Annotation;

/**
 * 定义联合校验逻辑
 *
 * @param <T>
 */
public interface UnionFieldValidator<T, A extends Annotation> {

    /**
     * @param objValue 校验对象
     * @return
     */
    Result valid(T objValue, A anno);


    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    class Result {
        private boolean valid;
        private String message;

    }
}
